home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / sys / amiga / programmer / 4791 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.4 KB

  1. Path: news.central.ntua.gr!not-for-mail
  2. From: hnick@central.ntua.gr (Nick C. Fotis)
  3. Newsgroups: comp.sys.amiga.programmer
  4. Subject: Re: Disk Space Left
  5. Date: 2 Mar 1996 14:50:49 GMT
  6. Organization: National Technical University of Athens, Greece
  7. Message-ID: <4h9n89$2g@zeus.central.ntua.gr>
  8. References: <DnL5B6.62u.0.staffin.dcs.ed.ac.uk@dcs.ed.ac.uk>
  9. NNTP-Posting-Host: gate2-zeus.central.ntua.gr
  10. X-Newsreader: NN version 6.5.0 #1 (NOV)
  11.  
  12. cdc@dcs.ed.ac.uk (Christopher Carr) writes:
  13.  
  14. >    How do you correctly calculate the available disk space
  15. >left on any single device. I am referring to the the fact that some
  16. >small files take a minimun block size.
  17.  
  18. Get a lock on the device you are interested, and then use dos.library's 
  19. Info function which will fill a struct InfoData with information for you.
  20. (the struct *must* be longword alligned)
  21. Now in the InfoData structure you will find:
  22. LONG      id_NumBlocks;
  23. LONG      id_NumBlocksUsed;
  24. LONG      id_BytesPerBlock;
  25. So something like (id_NumBlocks - id_NumBlocksUsed) * id_BytesPerBlock
  26. might give you what you want....hopefully! ;-)
  27. Cheers,
  28. /Alex
  29.  
  30. --
  31.  
  32. +----------------------------------------------------------------------------+
  33. | Alkinoos Alexandros Argiropoulos                  A1200, '030@40, 6MB Fast |
  34. | Athens, Greece                       "AAA is not a chipset...It's my name" |
  35. +----------------------------------------------------------------------------+
  36.